package track;

import io.DbFuncs;

public class Disc {
	
	private int _id;
	private SubGenre _subGenre = null;
	private String _name = null;

	public Disc(int id)
	{
		this._id = id;
	}
	
	public Disc(int id, SubGenre genre, String name)
	{
		this(id);
		this._subGenre = genre;
		this._name = name;
	}
	
	/**
	 * All the get functions
	 * 
	 * @return int
	 */
	public int getId()
	{
		return this._id;
	}
	/**
	 * @return SubGenre
	 */
	public SubGenre getSubGenre()
	{
		if(this._subGenre == null)
			this._subGenre = new SubGenre(DbFuncs.getContentInt("discs", "sub_genre_id", "id", this._id));
		
		return this._subGenre;
	}
	/**
	 * @return String
	 */
	public String getName()
	{
		if(this._name == null)
			this._name = DbFuncs.getContentString("discs", "name", "id", this._id);
		
		return this._name;
	}
	
	/**
	 * All the set functions
	 * 
	 * @param SubGenre
	 */
	public void setSubGenre(SubGenre subGenre)
	{
		this._subGenre = subGenre;
	}
	/**
	 * @param String
	 */
	public void setName(String name)
	{
		this._name = name;
	}
}
